﻿@using System.Collections.Generic
@using System.Linq
@using Microsoft.AspNetCore.Http
 
@model LoginViewModel
@inject SignInManager<IdentityUser> SignInManager

@{
    ViewData["Title"] = "登录";
    Layout = "_LayoutAdminlteBlank";
}

@if (ViewData["error"] != null)
{
    <input type="hidden" id="error" value="@ViewData["error"].ToString()" />
}

<div class="login-box-body">
    <p class="login-box-msg"><b>登录</b></p>
    <form asp-route-returnurl="@ViewData["ReturnUrl"]" method="post">

        <div class="form-group has-feedback">
            <label asp-for="UserName"></label>
            <input asp-for="UserName" class="form-control" />
            <span class="glyphicon glyphicon-user form-control-feedback"></span>
            <span asp-validation-for="UserName" class="text-danger"></span>
        </div>
        <div class="form-group has-feedback">
            <label asp-for="Password"></label>
            <input asp-for="Password" class="form-control" />
            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            <span asp-validation-for="Password" class="text-danger"></span>
        </div>
        <div class="row">
         
            <!-- /.col -->
            <div class="col-xs-12">
                <button type="submit" class="btn btn-primary btn-block btn-flat">登录</button>
            </div>
            <!-- /.col -->
        </div>

        <hr style="padding:0px" />
         
    </form>



</div>


@section Scripts {
    @await Html.PartialAsync("_ValidationScriptsPartial")
    <script>
        $(document).ready(function () {
            var error = $('#error').val();
            if (error) {
                ShowMessageError(error);
            }

        });
    </script>
}
